<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="EditSprintBacklog.aspx.cs" Trace="false" Inherits="EditSprintBacklog" Title="Tackle - Edit Sprint Backlog" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="Server">
    <strong>Edit Sprint Backlog<br />
        <br />
    </strong><span style="font-size: 8pt">This page allows the editing of sprint backlog
        items. This page is sorted by the master rank.</span><br />
    <br />
    <table width="98%" cellpadding="4" cellspacing="0">
        <tr>
            <td width="20%" style="border-top: silver 1px ridge; border-left: silver 1px ridge;
                border-bottom: silver 1px ridge;" bgcolor="#e3eaeb" valign="top">
                <asp:UpdatePanel runat="server" ID="UPSprintSelection" UpdateMode="Always">
                    <ContentTemplate>
                        <span style="font-size: x-small">Sprint:</span>&nbsp;<asp:DropDownList ID="ddSprintSelection"
                            runat="server" AutoPostBack="True" DataSourceID="dsGetSprintNames" DataTextField="SprintName"
                            DataValueField="SprintID" Font-Size="X-Small" OnDataBound="ddSprintSelection_DataBound"
                            OnSelectedIndexChanged="ddSprintSelection_SelectedIndexChanged" Font-Names="Verdana">
                        </asp:DropDownList>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td style="border-top: silver 1px ridge; border-bottom: silver 1px ridge;" bgcolor="#e3eaeb"
                valign="top">
                <asp:UpdatePanel runat="server" ID="UPFilter" UpdateMode="Always">
                    <ContentTemplate>
                        <span style="font-size: x-small">Filter:
                            <asp:DropDownList ID="ddFilterProdFeature" runat="server" AutoPostBack="True" DataSourceID="dsFilterProdFeature"
                                DataTextField="ProdFeature" DataValueField="MasterBacklogID" Font-Names="Verdana"
                                Font-Size="X-Small" OnSelectedIndexChanged="ddFilterProdFeature_SelectedIndexChanged"
                                OnDataBound="ddFilterProdFeature_DataBound">
                                <asp:ListItem Value="-3">All</asp:ListItem>
                                <asp:ListItem Value="-2">OOF</asp:ListItem>
                                <asp:ListItem Value="-1">Discovered</asp:ListItem>
                            </asp:DropDownList></span>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td bgcolor="#e3eaeb" style="border-top: silver 1px ridge; border-bottom: silver 1px ridge;
                text-align: right" valign="top" width="20%">
                <asp:UpdatePanel ID="UPUserFilter" runat="server">
                    <ContentTemplate>
                        <span style="font-size: x-small">Owner:&nbsp;</span><asp:DropDownList ID="ddUserFilter"
                            runat="server" AutoPostBack="True" DataSourceID="dsTaskOwners" DataTextField="Owner"
                            DataValueField="PersonID" Font-Names="Verdana" Font-Size="X-Small"
                            OnSelectedIndexChanged="ddUserFilter_SelectedIndexChanged">
                        </asp:DropDownList>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostbackTrigger ControlID="ddSprintSelection" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
            <td style="border-top: silver 1px ridge; border-right: silver 1px ridge; border-bottom: silver 1px ridge;
                text-align: right;" bgcolor="#e3eaeb" valign="top">
                <asp:Button ID="btnAddFeatureToSprint" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                    OnClick="btnAddFeatureToSprint_Click" Text="Add Backlog Item" ToolTip="Add an item from the master backlog for this scrum team to this sprint" /></td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:Label ID="lblCantDelete" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                    ForeColor="Red" Text="The task cannot be deleted as associated sprint backlog time entries exist."
                    Visible="False"></asp:Label><br />
                <asp:UpdatePanel runat="server" ID="UPDataList" UpdateMode="Always">
                    <ContentTemplate>
                        <asp:DataList ID="dlProdFeatureList" runat="server" DataKeyField="MasterBacklogID"
                            DataSourceID="dsSprintBacklogProdFeature" Width="100%" OnPreRender="dlProdFeatureList_PreRender">
                            <ItemTemplate>
                                <table width="100%" cellpadding="0" style="border-right: silver 1px ridge; border-top: silver 1px ridge;
                                    border-left: silver 1px ridge; border-bottom: silver 1px ridge" height="1" cellspacing="0"
                                    id="TABLE1">
                                    <tr>
                                        <td colspan="3" bgcolor="#c0c0c0">
                                            <span style="font-size: x-small">&nbsp;</span><asp:LinkButton ID="lbFeatureLink"
                                                runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small" ForeColor="Black"
                                                OnClick="lbFeatureLink_Click" Text='<%# Eval("ProdFeature") %>' ToolTip='Click to Filter to this Task'
                                                CommandArgument='<%# Eval("MasterBacklogID") %>'></asp:LinkButton><span style="font-size: x-small">
                                                </span>
                                            <asp:Label ID="lblMBID" runat="server" Font-Size="X-Small" Text='<%# Eval("MasterBacklogID") %>'
                                                Visible="False" ForeColor="Black" Font-Bold="False" Font-Italic="False" ToolTip="Master Backlog Item ID"></asp:Label><span
                                                    style="font-size: x-small"> </span><span style="color: black"><span style="font-size: x-small">
                                                        - </span>
                                                        <asp:Label ID="subTotal" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            ForeColor="Black" ToolTip="Base Hours Total Allocated"></asp:Label><span style="font-size: x-small">
                                                                of </span></span>
                                            <asp:Label ID="baseTotal" runat="server" Text='<%# Eval("BaseTime", "{0:F}") %>' Font-Names="Verdana"
                                                Font-Size="X-Small" ForeColor="Black" ToolTip="Base Hours from Product Backlog"></asp:Label>
                                            <asp:Label ID="lblHoursOrDays" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                ForeColor="Black" OnPreRender="lblHoursOrDays_PreRender"></asp:Label><span
                                                    style="font-size: x-small"><span>
                                                    </span><span> allocated.</span><span style="color: black"><span><span>
                                                        <span><strong></strong></span></span></span></span></span><span>
                                                            <br />
                                                            <span style="font-size: 1pt">
                                                                <br />
                                                            </span><span style="font-size: x-small; color: #ffffff"></span><span style="font-size: x-small;
                                                                color: #ffffff"></span></span>
                                            <asp:GridView ID="gvSprintBacklogPerMBID" runat="server" AutoGenerateColumns="False"
                                                CellPadding="4" DataKeyNames="SprintBacklogID" DataSourceID="dsSprintBacklog"
                                                Font-Names="Verdana" Font-Size="X-Small" ForeColor="#333333" GridLines="None"
                                                HorizontalAlign="Left" OnRowDeleting="GridView_RowDeleting" OnDataBound="GridView_DataBound"
                                                Width="100%" OnPreRender="GridView_PreRender" OnRowUpdating="UpdateBacklogAndDailyScrumTime"
                                                AllowSorting="True" OnRowDataBound="gvSprintBacklogPerMBID_RowDataBound" OnRowCancelingEdit="GridView_CancelEdit" OnRowDeleted="GridView_RowDeleted" OnRowEditing="GridView_RowEditing" OnRowUpdated="GridView_RowUpdated">
                                                <FooterStyle BackColor="#1C5E55" Font-Bold="False" ForeColor="White" />
                                                <Columns>
                                                    <asp:BoundField DataField="SprintBacklogID" HeaderText="ID" InsertVisible="False"
                                                        ReadOnly="True" SortExpression="SprintBacklogID" Visible="False" />
                                                <asp:TemplateField HeaderText="Feature" SortExpression="Feature" Visible="False">
                                                    <EditItemTemplate>
                                                        <asp:DropDownList ID="ddFeatureList" runat="server" DataSourceID="dsFeatures" DataTextField="Feature"
                                                            DataValueField="MasterBacklogID" Font-Names="Verdana" Font-Size="X-Small" SelectedValue='<%# Bind("fMasterBacklogID") %>'>
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Task" SortExpression="Task">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBoxTask" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                Height="36px" MaxLength="255" Text='<%# Bind("Task") %>' TextMode="MultiLine"
                                                                Width="95%" ToolTip="The description of the task to be completed by the task owner"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="rfvTask" runat="server" ControlToValidate="TextBoxTask"
                                                                ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana" Font-Size="Small"
                                                                ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:CustomValidator
                                                                    ID="cvalidTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="* Only 255 chars allowed."
                                                                    ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="255"></asp:CustomValidator>
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="45%" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Task") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Owner" SortExpression="Person">
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsResourceName"
                                                                DataTextField="Person" DataValueField="SprintResourcesID" Font-Names="Verdana"
                                                                Font-Size="X-Small" SelectedValue='<%# Bind("TaskOwnerID") %>'>
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Person") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="10%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="TaskOwnerID" SortExpression="TaskOwnerID" Visible="False">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox3" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                Text='<%# Bind("TaskOwnerID") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("TaskOwnerID") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Base" SortExpression="BaseTime">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtBaseTime" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                Text='<%# Bind("BaseTime", "{0:F}") %>' Width="50px" ToolTip="Base time for the task" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator
                                                                    ID="rfv4" runat="server" ControlToValidate="txtBaseTime" ErrorMessage="*?" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                        ID="rv4" runat="server" ControlToValidate="txtBaseTime" ErrorMessage="*#" ForeColor="LightCoral"
                                                                        Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                        ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblBaseTime" runat="server" Text='<%# Bind("BaseTime", "{0:F}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Unbuff" SortExpression="Unbuffered">
                                                        <EditItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' Enabled="false"
                                                                ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Disc" SortExpression="Discovered">
                                                        <EditItemTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' Enabled="false"
                                                                ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Pri" SortExpression="Priority">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox1" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                OnPreRender="SetupOnFocus_PreRender" Text='<%# Bind("Priority", "{0}") %>' Width="50px" ToolTip="The priority of the task. This list of tasks is sorted on this column by default."></asp:TextBox><asp:RequiredFieldValidator
                                                                    ID="rfv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*?" Font-Names="Verdana"
                                                                    Font-Size="Small" ForeColor="LightCoral" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                        ID="rv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*#" Font-Names="Verdana"
                                                                        Font-Size="Small" ForeColor="LightCoral" MaximumValue="10000" MinimumValue="0"
                                                                        ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label6" runat="server" Text='<%# Eval("Priority", "{0:F}") %>' ToolTip="The priority of the task. This list of tasks is sorted on this column by default."></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Notes" SortExpression="Notes">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox5" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                Height="36px" MaxLength="255" Text='<%# Bind("Notes") %>' TextMode="MultiLine"
                                                                Width="95%" ToolTip="Any notes associated with the task"></asp:TextBox><br />
                                                            <asp:CustomValidator ID="cvalidNotes" runat="server" ControlToValidate="TextBox5"
                                                                ErrorMessage="* Only 255 chars allowed." ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate"
                                                                ToolTip="255"></asp:CustomValidator>
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="20%" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lbCopy" runat="server" CausesValidation="False" ForeColor="Black"
                                                            OnClick="lbCopy_Click" Text="Copy" ToolTip="Make a duplicate entry of this task"></asp:LinkButton><br />
                                                            <asp:LinkButton ID="lbSplit" runat="server" CausesValidation="False" ForeColor="Black"
                                                            OnClick="lbSplit_Click" Text="Split" ToolTip="Split the feature, dividing the time in half and creating a new task"/>
                                                            <asp:Label ID="lblSBID2" runat="server" Text='<%# Eval("SprintBacklogID") %>' Visible="False"/>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:Label ID="lblSBID2" runat="server" Text='<%# Eval("SprintBacklogID") %>' Visible="False"/>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:CommandField ShowEditButton="True">
                                                        <ItemStyle HorizontalAlign="Center" Width="5%" />
                                                    </asp:CommandField>
                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="linkButtonDelete" runat="server" CommandName="Delete" ForeColor="Black"
                                                                OnClientClick="return confirm('This will also delete all time updates associated with this task.\n\nAre you sure you want to delete this task?');">Delete</asp:LinkButton><br />
                                                            <asp:LinkButton ID="lbPuntSprint" runat="server" ForeColor="Black" OnClick="lbPuntSprint_Click"
                                                                OnClientClick="return confirm('This will create a new feature in the product backlog and remove this task from the sprint backlog.\n\nAre you sure you want to punt this task?');"
                                                                ToolTip="Punts the task to the master backlog for a future sprint">Punt</asp:LinkButton><asp:Label
                                                                    ID="lblSBID" runat="server" Text='<%# Eval("SprintBacklogID") %>' Visible="False"></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" Width="5%" />
                                                    </asp:TemplateField>
                                                </Columns>
                                                <RowStyle BackColor="#E3EAEB" VerticalAlign="Top" />
                                                <EditRowStyle BackColor="#7C6F57" ForeColor="White" />
                                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                                <AlternatingRowStyle BackColor="White" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td bgcolor="#c0c0c0" colspan="3" style="width: 416px">
                                            <span style="font-size: 1em"><span style="font-size: 1pt">
                                                <br />
                                                <span style="font-size: x-small; color: #ffffff"></span><span style="font-size: x-small;
                                                    color: #ffffff"></span></span></span>&nbsp;<asp:LinkButton ID="lbNewBacklogTask"
                                                        runat="server" CommandArgument='<%# Eval("MasterBacklogID") %>' CommandName="NewBacklogTask"
                                                        Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small" ForeColor="#1C5E55"
                                                        OnClick="lbNewBacklogTask_Click">New Task</asp:LinkButton><span style="font-size: x-small"></span></td>
                                    </tr>
                                </table>
                                <asp:SqlDataSource ID="dsSprintBacklog" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                    SelectCommand="SELECT tblSprintBacklog.SprintBacklogID, tblSprintBacklog.Task, tblSprintResources.Person, tblSprintBacklog.TaskOwnerID, tblSprintBacklog.BaseTime * @TimeMult AS BaseTime, tblSprintBacklog.Notes, IsNull(tblSprintBacklog.Unbuffered, 0) as Unbuffered, tblSprintBacklog.Discovered, tblSprintBacklog.fMasterBacklogID, tblSprintBacklog.fSprintID, tblSprintBacklog.Priority FROM tblSprintBacklog INNER JOIN tblSprintResources ON tblSprintBacklog.TaskOwnerID = tblSprintResources.SprintResourcesID WHERE (tblSprintBacklog.fMasterBacklogID = @MasterBacklogID) AND (tblSprintBacklog.fSprintID = @SprintID) AND (tblSprintResources.SprintResourcesID LIKE @Person) ORDER BY Priority, SprintBacklogID"
                                    DeleteCommand="DELETE FROM tblSprintBacklog WHERE (SprintBacklogID = @original_SprintBacklogID)"
                                    OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE tblSprintBacklog SET Task = @Task, TaskOwnerID = @TaskOwnerID, BaseTime = @BaseTime, Notes = @Notes, Unbuffered = @Unbuffered, Discovered = @Discovered, Priority = @Priority, fMasterBacklogID=@fMasterBacklogID WHERE (SprintBacklogID = @original_SprintBacklogID)" OnUpdating="GridView_Updating" OnDeleting="dsSprintBacklog_Deleting">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="lblMBID" Name="MasterBacklogID" PropertyName="Text" />
                                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                        <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
                                        <asp:ControlParameter ControlID="ddUserFilter" Name="Person" PropertyName="SelectedValue" />
                                    </SelectParameters>
                                    <DeleteParameters>
                                        <asp:Parameter Name="original_SprintBacklogID" />
                                    </DeleteParameters>
                                    <UpdateParameters>
                                        <asp:Parameter Name="Task" />
                                        <asp:Parameter Name="TaskOwnerID" />
                                        <asp:Parameter Name="BaseTime" />
                                        <asp:Parameter Name="Notes" />
                                        <asp:Parameter Name="Unbuffered" />
                                        <asp:Parameter Name="Discovered" />
                                        <asp:Parameter Name="Priority" />
                                        <asp:Parameter Name="fMasterBacklogID" />
                                        <asp:Parameter Name="original_SprintBacklogID" />
                                    </UpdateParameters>
                                </asp:SqlDataSource>
                                <br />
                            </ItemTemplate>
                        </asp:DataList>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:SqlDataSource ID="dsSprintBacklogProdFeature" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                    SelectCommand="SELECT DISTINCT tblProducts.ProductName, tblMasterBacklog.Feature, tblMasterBacklog.MasterBacklogID, tblProducts.ProductName + ' : ' + tblMasterBacklog.Feature + ' : ' + tblMasterBacklog.Activity AS ProdFeature, tblMasterBacklog.Hours * @TimeMult AS BaseTime, tblMasterBacklog.MasterRank, tblMasterBacklog.Description, tblMasterBacklog.fProductID FROM tblMasterBacklog INNER JOIN tblSprintBacklog ON tblMasterBacklog.MasterBacklogID = tblSprintBacklog.fMasterBacklogID INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID WHERE (tblSprintBacklog.fSprintID = @SprintID) ORDER BY tblMasterBacklog.MasterRank">
                    <SelectParameters>
                        <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsFilterProdFeature" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                    SelectCommand="SELECT DISTINCT tblMasterBacklog.MasterBacklogID, tblProducts.ProductName + ' : ' + tblMasterBacklog.Feature + ' : ' + Activity AS ProdFeature, tblMasterBacklog.MasterRank AS MasterRank FROM tblMasterBacklog INNER JOIN tblSprintBacklog ON tblMasterBacklog.MasterBacklogID = tblSprintBacklog.fMasterBacklogID INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID WHERE (tblSprintBacklog.fSprintID = @SprintID) UNION SELECT - 3 AS MasterBacklogID, ' All' AS ProdFeature, - 3 AS MasterRank UNION SELECT - 2 AS MasterBacklogID, ' OOF' AS ProdFeature, - 2 AS MasterRank UNION SELECT - 1 AS MasterBacklogID, ' Discovered' AS ProdFeature, - 1 AS MasterRank ORDER BY ProdFeature">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsTaskOwners" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                    SelectCommand="SELECT DISTINCT dbo.tblSprintResources.Person AS Owner, CONVERT(nvarchar, dbo.tblSprintResources.SprintResourcesID) AS PersonID&#13;&#10;FROM         dbo.tblSprintBacklog INNER JOIN&#13;&#10;                      dbo.tblSprintResources ON dbo.tblSprintBacklog.TaskOwnerID = dbo.tblSprintResources.SprintResourcesID&#13;&#10;WHERE     (dbo.tblSprintBacklog.fSprintID = @SprintID)&#13;&#10;UNION&#13;&#10;SELECT     TOP (100) PERCENT ' All' AS Owner, '%' AS PersonID&#13;&#10;ORDER BY Owner">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsFeatures" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                    SelectCommand="SELECT DISTINCT TOP (100) PERCENT tblMasterBacklog.MasterBacklogID, tblProducts.ProductName + ':' + tblMasterBacklog.Feature AS Feature FROM tblMasterBacklog INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID INNER JOIN tblScrumTeam ON tblScrumTeam.ScrumTeamProductListID = tblProducts.fScrumTeamProductListID INNER JOIN tblSprintBacklog ON tblMasterBacklog.MasterBacklogID = tblSprintBacklog.fMasterBacklogID WHERE (tblSprintBacklog.fSprintID = @SprintID) ORDER BY Feature">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                        <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:UpdatePanel runat="server" ID="UPGVOOF" UpdateMode="Always">
                    <ContentTemplate>
                        <asp:Panel ID="panelOOFHours" runat="server" Width="100%">
                            <table style="border-right: silver 1px ridge; border-top: silver 1px ridge; border-left: silver 1px ridge;
                                border-bottom: silver 1px ridge" width="100%" cellpadding="0" cellspacing="0">
                                <tr style="font-size: 10pt">
                                    <td bgcolor="silver">
                                        &nbsp;<asp:LinkButton ID="lbShowOOF" runat="server" Font-Bold="True" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="Black" OnClick="lbFeatureLink_Click" Text="OOF"
                                            ToolTip="Click to Filter to this Backlog Item" CommandArgument="-2"></asp:LinkButton><br />
                                        <span style="font-size: 1pt">
                                            <br />
                                        </span><span style="font-size: x-small; color: #ffffff"></span><span style="font-size: x-small;
                                            color: #ffffff"></span>
                                        <asp:GridView ID="gvOOFTasks" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                            DataKeyNames="SprintBacklogID" DataSourceID="dsOOFTasks" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#333333" GridLines="None" Width="100%" OnRowDeleting="GridView_RowDeleting"
                                            OnDataBound="GridView_DataBound" OnPreRender="GridView_PreRender" OnRowUpdating="UpdateBacklogAndDailyScrumTime"
                                            AllowSorting="True" OnRowCancelingEdit="GridView_CancelEdit" OnRowDeleted="GridView_RowDeleted" OnRowEditing="GridView_RowEditing" OnRowUpdated="GridView_RowUpdated" OnRowDataBound="GridView_RowDataBound">
                                            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <Columns>
                                                <asp:BoundField DataField="SprintBacklogID" HeaderText="ID" InsertVisible="False"
                                                    ReadOnly="True" SortExpression="SprintBacklogID" Visible="False" />
                                                <asp:TemplateField HeaderText="Task" SortExpression="Task">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBoxTask" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Task") %>' TextMode="MultiLine"
                                                            Width="95%" ToolTip="'OOF' or a description of the OOF"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvTask" runat="server" ControlToValidate="TextBoxTask"
                                                            ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana" Font-Size="Small"
                                                            ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:CustomValidator
                                                                ID="cvalidTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="* Only 255 chars allowed."
                                                                ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="45%" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Task") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="TaskOwnerID" HeaderText="TaskOwnerID" SortExpression="TaskOwnerID"
                                                    Visible="False" />
                                                <asp:TemplateField HeaderText="Owner" SortExpression="Person">
                                                    <EditItemTemplate>
                                                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsResourceName"
                                                            DataTextField="Person" DataValueField="SprintResourcesID" Font-Names="Verdana"
                                                            Font-Size="X-Small" SelectedValue='<%# Bind("TaskOwnerID") %>'>
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Person") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="10%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Base" SortExpression="BaseTime">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox4" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Text='<%# Bind("BaseTime", "{0:F}") %>' Width="50px" ToolTip="Base time for the OOF" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator
                                                                ID="rfv4" runat="server" ControlToValidate="TextBox4" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv4" runat="server" ControlToValidate="TextBox4" ErrorMessage="*#" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                    ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblBaseTime" runat="server" Text='<%# Bind("BaseTime", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="OOF" SortExpression="OOF">
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("OOF") %>' Enabled="false"
                                                            ToolTip="An OOF task is a time spent out of the office unrelated to any feature tasks. Sick leave, vacation, holidays should be marked OOF." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Disc" SortExpression="Discovered">
                                                    <EditItemTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' Enabled="false"
                                                            ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Notes" SortExpression="Notes">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox5" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Notes") %>' TextMode="MultiLine"
                                                            Width="95%" ToolTip="Any notes associated with the OOF"></asp:TextBox><br />
                                                        <asp:CustomValidator ID="cvalidNotes" runat="server" ControlToValidate="TextBox5"
                                                            ErrorMessage="* Only 255 chars allowed." ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate"
                                                            ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="20%" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lbCopy" runat="server" CausesValidation="False" ForeColor="Black"
                                                        OnClick="lbCopy_Click" Text="Copy" ToolTip="Make a duplicate entry of this task"></asp:LinkButton><br />
                                                        <asp:LinkButton ID="lbSplit" runat="server" CausesValidation="False" ForeColor="Black"
                                                        OnClick="lbSplit_Click" Text="Split" ToolTip="Split the feature, dividing the time in half and creating a new task"/>
                                                        <asp:Label ID="lblSBID2" runat="server" Text='<%# Eval("SprintBacklogID") %>' Visible="False"/>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="lblSBID2" runat="server" Text='<%# Eval("SprintBacklogID") %>' Visible="False"/>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>
                                                <asp:CommandField ShowEditButton="True">
                                                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                                                </asp:CommandField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="linkButtonDelete" runat="server" CommandName="Delete" ForeColor="Black"
                                                            OnClientClick="return confirm('This will also delete all time updates associated with this task.\n\nAre you sure you want to delete this task?');">Delete</asp:LinkButton>
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                                                </asp:TemplateField>
                                            </Columns>
                                            <RowStyle BackColor="#E3EAEB" VerticalAlign="Top" />
                                            <EditRowStyle BackColor="#7C6F57" VerticalAlign="Top" ForeColor="White" />
                                            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <AlternatingRowStyle BackColor="White" />
                                        </asp:GridView>
                                        <span style="font-size: 1pt"></span>
                                    </td>
                                </tr>
                                <tr style="font-size: 10pt">
                                    <td bgcolor="silver">
                                        &nbsp;<asp:LinkButton ID="lbNewOOFTask" runat="server" Font-Bold="True" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#1C5E55" OnClick="lbNewOOFTask_Click">New Task</asp:LinkButton><br />
                                    </td>
                                </tr>
                            </table>
                            <asp:SqlDataSource ID="dsOOFTasks" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                DeleteCommand="DELETE FROM tblSprintBacklog WHERE (SprintBacklogID = @original_SprintBacklogID)"
                                OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                SelectCommand="SELECT tblSprintBacklog.fMasterBacklogID, tblSprintBacklog.Task, tblSprintResources.Person, tblSprintBacklog.BaseTime * @TimeMult AS BaseTime, tblSprintBacklog.Notes, tblSprintBacklog.OOF, tblSprintBacklog.SprintBacklogID, tblSprintBacklog.TaskOwnerID, tblSprintBacklog.Discovered FROM tblSprintBacklog INNER JOIN tblSprintResources ON tblSprintBacklog.TaskOwnerID = tblSprintResources.SprintResourcesID WHERE (tblSprintBacklog.fSprintID = @SprintID) AND (tblSprintBacklog.OOF = 1) AND (tblSprintBacklog.fMasterBacklogID IS NULL)"
                                UpdateCommand="UPDATE tblSprintBacklog SET Task = @Task, TaskOwnerID = @TaskOwnerID, BaseTime = @BaseTime, Notes = @Notes, Discovered=@Discovered WHERE (SprintBacklogID = @original_SprintBacklogID)" OnUpdating="GridView_Updating" OnDeleting="dsSprintBacklog_Deleting">
                                <DeleteParameters>
                                    <asp:Parameter Name="original_SprintBacklogID" />
                                </DeleteParameters>
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                    <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
                                </SelectParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="Task" />
                                    <asp:Parameter Name="TaskOwnerID" />
                                    <asp:Parameter Name="BaseTime" />
                                    <asp:Parameter Name="Notes" />
                                    <asp:Parameter Name="Discovered" />
                                    <asp:Parameter Name="original_SprintBacklogID" />
                                </UpdateParameters>
                            </asp:SqlDataSource>
                            <br />
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr style="font-size: 10pt">
            <td colspan="4">
                <asp:UpdatePanel runat="server" ID="UPGVDisc" UpdateMode="Always">
                    <ContentTemplate>
                        <asp:Panel ID="panelDiscovered" runat="server" Width="100%">
                            <table style="border-right: silver 1px ridge; border-top: silver 1px ridge; border-left: silver 1px ridge;
                                border-bottom: silver 1px ridge" width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="100%" bgcolor="silver">
                                        &nbsp;<asp:LinkButton ID="lbShowDiscovered" runat="server" Font-Bold="True" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="Black" OnClick="lbFeatureLink_Click" Text="Discovered"
                                            ToolTip="Click to Filter to this Backlog Item" CommandArgument="-1"></asp:LinkButton><br />
                                        <span style="font-size: 1pt">
                                            <br />
                                        </span><span style="font-size: x-small; color: #ffffff"></span><span style="font-size: x-small;
                                            color: #ffffff"></span>
                                        <asp:GridView ID="gvDiscoveredTasks" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                            DataKeyNames="SprintBacklogID" DataSourceID="dsDiscoveredTasks" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#333333" GridLines="None" Width="100%" OnRowDeleting="GridView_RowDeleting"
                                            OnDataBound="GridView_DataBound" OnPreRender="GridView_PreRender" AllowSorting="True" OnRowCancelingEdit="GridView_CancelEdit" OnRowDeleted="GridView_RowDeleted" OnRowEditing="GridView_RowEditing" OnRowUpdated="GridView_RowUpdated" OnRowUpdating="UpdateBacklogAndDailyScrumTime" OnRowDataBound="GridView_RowDataBound">
                                            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <Columns>
                                                <asp:BoundField DataField="SprintBacklogID" HeaderText="ID" InsertVisible="False"
                                                    ReadOnly="True" SortExpression="SprintBacklogID" Visible="False" />
                                                <asp:TemplateField HeaderText="Task" SortExpression="Task">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBoxTask" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Task") %>' TextMode="MultiLine"
                                                            Width="95%" ToolTip="A description of the discovered work. This should not be a task related to any other products in the sprint backlog"></asp:TextBox><br />
                                                        <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="TextBoxTask"
                                                            ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana" Font-Size="Small"
                                                            ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:CustomValidator
                                                                ID="cvalidTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="* Only 255 chars allowed."
                                                                ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="45%" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Task") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="TaskOwnerID" HeaderText="TaskOwnerID" SortExpression="TaskOwnerID"
                                                    Visible="False" />
                                                <asp:TemplateField HeaderText="Owner" SortExpression="Person">
                                                    <EditItemTemplate>
                                                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsResourceName"
                                                            DataTextField="Person" DataValueField="SprintResourcesID" Font-Names="Verdana"
                                                            Font-Size="X-Small" SelectedValue='<%# Bind("TaskOwnerID") %>'>
                                                        </asp:DropDownList>&nbsp;
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Person") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="10%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Base" SortExpression="BaseTime">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox4" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Text='<%# Bind("BaseTime", "{0:F}") %>' Width="50px" ToolTip="Base time for the task"
                                                            Enabled="False" ReadOnly="True" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator ID="rfv4"
                                                                runat="server" ControlToValidate="TextBox4" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv4" runat="server" ControlToValidate="TextBox4" ErrorMessage="*#" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                    ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblBaseTime" runat="server" Text='<%# Bind("BaseTime", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Unbuff" SortExpression="Unbuffered">
                                                    <EditItemTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' Enabled="false"
                                                            ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Disc" SortExpression="Discovered">
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' Enabled="false"
                                                            ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Notes" SortExpression="Notes">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox5" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Notes") %>' TextMode="MultiLine"
                                                            Width="95%" ToolTip="Any notes associated with this discovered task"></asp:TextBox><br />
                                                        <asp:CustomValidator ID="cvalidNotes" runat="server" ControlToValidate="TextBox5"
                                                            ErrorMessage="* Only 255 chars allowed." ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate"
                                                            ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="20%" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lbCopy" runat="server" CausesValidation="False" ForeColor="Black"
                                                        OnClick="lbCopy_Click" Text="Copy" ToolTip="Make a duplicate entry of this task"></asp:LinkButton><br />
                                                        <asp:LinkButton ID="lbSplit" runat="server" CausesValidation="False" ForeColor="Black"
                                                        OnClick="lbSplit_Click" Text="Split" ToolTip="Split the feature, dividing the time in half and creating a new task"/>
                                                        <asp:Label ID="lblSBID2" runat="server" Text='<%# Eval("SprintBacklogID") %>' Visible="False"/>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="lblSBID2" runat="server" Text='<%# Eval("SprintBacklogID") %>' Visible="False"/>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>
                                                <asp:CommandField ShowEditButton="True">
                                                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                                                </asp:CommandField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="linkButtonDelete" runat="server" CommandName="Delete" ForeColor="Black"
                                                            OnClientClick="return confirm('This will also delete all time updates associated with this task.\n\nAre you sure you want to delete this task?');">Delete</asp:LinkButton>
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                                                </asp:TemplateField>
                                            </Columns>
                                            <RowStyle BackColor="#E3EAEB" VerticalAlign="Top" />
                                            <EditRowStyle BackColor="#7C6F57" VerticalAlign="Top" ForeColor="White" />
                                            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <AlternatingRowStyle BackColor="White" />
                                        </asp:GridView>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="silver" width="100%">
                                        &nbsp;<asp:LinkButton ID="lbDiscNewTask" runat="server" Font-Bold="True" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#1C5E55" OnClick="lbDiscNewTask_Click">New Task</asp:LinkButton><br />
                                    </td>
                                </tr>
                            </table>
                            <asp:SqlDataSource ID="dsDiscoveredTasks" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                DeleteCommand="DELETE FROM tblSprintBacklog WHERE (SprintBacklogID = @original_SprintBacklogID)"
                                OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                SelectCommand="SELECT tblSprintBacklog.Task, tblSprintResources.Person, (tblSprintBacklog.BaseTime * @TimeMult) as BaseTime, tblSprintBacklog.Notes, IsNull(tblSprintBacklog.Unbuffered,0) as Unbuffered, tblSprintBacklog.SprintBacklogID, tblSprintBacklog.TaskOwnerID, tblSprintBacklog.Discovered FROM tblSprintBacklog INNER JOIN tblSprintResources ON tblSprintBacklog.TaskOwnerID = tblSprintResources.SprintResourcesID WHERE (tblSprintBacklog.fSprintID = @SprintID) AND (tblSprintBacklog.fMasterBacklogID IS NULL) AND (tblSprintBacklog.Discovered = 1) AND (OOF = 0)"
                                UpdateCommand="UPDATE tblSprintBacklog SET Task = @Task, TaskOwnerID = @TaskOwnerID, BaseTime = @BaseTime, Notes = @Notes, Unbuffered = @Unbuffered WHERE (SprintBacklogID = @original_SprintBacklogID)" OnUpdating="GridView_Updating" OnDeleting="dsSprintBacklog_Deleting">
                                <DeleteParameters>
                                    <asp:Parameter Name="original_SprintBacklogID" />
                                </DeleteParameters>
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                    <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="dsResourceName" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                SelectCommand="SELECT Person, SprintResourcesID FROM tblSprintResources WHERE (fSprintID = @SprintID) ORDER BY Person">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Always">
        <ContentTemplate>
            <table width="98%">
                <tr>
                    <td colspan="4" bgcolor="#eeebec" style="border-right: silver 1px ridge; border-top: silver 1px ridge; border-left: silver 1px ridge; border-bottom: silver 1px ridge; text-align: left">
                        <asp:CheckBox ID="chbShowFeatureInEditMode" runat="server" AutoPostBack="True"
                            Font-Names="Verdana" Font-Size="X-Small"
                            Text="Show Feature (Edit Mode)" ToolTip="Show or Hide the Feature column when in edit mode. This allows moving a task from one feature to another." OnCheckedChanged="chbShowFeatureInEditMode_CheckedChanged" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:SqlDataSource ID="dsGetSprintNames" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        SelectCommand="SELECT DISTINCT tblMasterBacklogSchedule.SprintName, tblMasterBacklogSchedule.EndDate, tblSprint.SprintID FROM tblSprint LEFT OUTER JOIN tblSprintBacklog ON tblSprint.SprintID = tblSprintBacklog.fSprintID RIGHT OUTER JOIN tblMasterBacklogSchedule ON tblSprint.fMasterBacklogScheduleID = tblMasterBacklogSchedule.MasterBacklogScheduleID WHERE (tblMasterBacklogSchedule.fScrumTeamID = @ScrumTeamID) AND (tblSprintBacklog.fSprintID IS NOT NULL) ORDER BY tblMasterBacklogSchedule.EndDate DESC">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
